Skip to main content

Test your integration with test Ads

To help you test your integration from the Unity Editor we have included mock or placeholder ads that mimic the behaviour of its native counterparts. This is useful to quickly test how your app flow works when showing ads and listening to the different callbacks, without having to build and run it on a physical device.

Once you finish testing your integration remember to run your app on a physical device, as these mock ads are only shown when launching the game using the Editor's play button.

Mock Banner AdMock Interstitial AdMock Rewarded Ad
Mock BannerMock InterstitialMock Rewarded

Request Test Ads

When testing you should request ads by setting the test flag to true when initializing XMediator and when creating ad instances. We use this flag to ask the underlying networks to provide us with test ads when possible.

info

Some mediation services (or their underlying networks) may not support this flag and might provide other means to test their integration, so make sure to always check their documentation for any additional steps.

We do provide test Placement Ids to enable a quick way to test the integration.

Test Placement Ids
PlacementMAX MediationLevelPlay Mediation
App keyV148L42DB1V148L42DB8
BannerV142DR9L2247MGV142DR2LD0QYR1
InterstitialV142DRJLE1G5XXV142DR1L7WJN07
RewardedV142DR4LW2MT4BV142DR8L1DP5ND

Currently, these placements are only supported for these ad networks: Google Ads, AppLovin, Chartboost, Unity Ads and Liftoff Monetize.

warning

Remember to replace these test placements with your own placements and always set the test flags to false in a production environment

Enable test mode

Set the test flag to true to see test ads when available.

var shouldRequestTestAds = Debug.isDebugBuild;

// Initialize
XMediatorAds.StartWith(
appKey: "V148L42DB1",
initSettings: new InitSettings(
test: shouldRequestTestAds,
userProperties: new UserProperties(
userId: "<your-user-id>"
)
),
initCallback: result =>
{
XMediatorAds.Banner.Create(placementId: "V142DR9L2247MG", size: BannerAds.Size.Phone, position: BannerAds.Position.Top);
XMediatorAds.Interstitial.Load(placementId: "V142DRJLE1G5XX");
XMediatorAds.Rewarded.Load(placementId: "V142DR4LW2MT4B");
}
);

Enable verbose logging

Setting the verbose flag to true will output extra logging information to Logcat on Android and to the standard output on iOS.

// Initialize
XMediatorAds.StartWith(
appKey: "<your-app-key>",
initSettings: new InitSettings(
verbose: true,
userProperties: new UserProperties(
userId: "<your-user-id>"
)
)
);